﻿using System;
using System.Html.DOM;

namespace enyo
{
    /// <summary>
    /// A control that displays a repeating list of rows. It is suitable for displaying medium-sized lists (maximum of ~100 items).
    /// A flyweight strategy is employed to render one set of row controls as needed for as many rows as are contained in the repeater.
    /// </summary>
    public class VirtualRepeater : Control
    {
        public bool Accelerated{get;set;}
        public bool StripSize{get;set;}

        //TODO:index, return bool???
        public EnyoCallback<bool, Control, int> onSetupRow;

        /// <summary>
        /// Updates the repeater's controls to act as if they were rendered in the row with the given index.
        /// </summary>
        /// <param name="rowIndex">RowIndex is the numeric index of the row to prepare.</param>
        public void ControlsToRow(int rowIndex)
        {
        }

        /// <summary>
        /// Fetches the index of the row that is currently receiving events.
        /// </summary>
        /// <returns></returns>
        public int FetchRowIndex()
        {
            return 0;
        }

        /// <summary>
        /// Fetches the row index for a node in a repeater row.
        /// </summary>
        /// <param name="node">node that is contained in a repeater row. </param>
        /// <returns>Returns the index of the row in which inNode exists.</returns>
        public int FetchRowIndexByNode(HtmlElement node)//TODO:Type correct?
        {
            return 0;
        }

        /// <summary>
        /// Fetches the DOM node for the given row index.
        /// </summary>
        /// <param name="rowIndex"></param>
        /// <returns></returns>
        public HtmlElement FetchRowNode(int rowIndex)
        {
            return null;
        }

        /// <summary>
        /// Re-renders the content for a given row.
        /// </summary>
        /// <param name="rowIndex">RowIndex is the numeric index of the row to render.</param>
        public void RenderRow(int rowIndex)
        {
        }
    }
}
